<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('product', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('type'); // 产品分类id
            $table->unsignedTinyInteger('recommend')
                ->nullable()->default(1); // 是否推荐 0推荐 1不推荐
            $table->string('name'); // 产品名
            $table->string('summary'); // 产品摘要
            $table->text('pictures')->nullable(); // 产品展示图集
            $table->longText('introduce'); // 产品介绍
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('product');
    }
}
